<template>
    <view class="container">
        <u-parse :html="vhtml"></u-parse>
    </view>
</template>

<script lang="ts" setup>
import { onLoad, onReady } from '@dcloudio/uni-app'
import { ref } from 'vue'

const type = ref('')
const vhtml = ref('')

onLoad((option: any) => {
    type.value = option.type
})

onReady(() => {
    uni.$u.$api.BaseApi.queryBaseAgreementApp().then((res: any) => {
        vhtml.value = res[type.value] && res[type.value].content
        if (res[type.value] && res[type.value].name) {
            uni.setNavigationBarTitle({
                title: res[type.value].name
            })
        }
    })
})
</script>

<style scoped lang="scss">
.container{
    padding: 20rpx 30rpx;
    min-height: calc(100vh - var(--status-bar-height) - 44px);
    background-color: white;
}
</style>
